package com.music.view;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;

@SuppressWarnings("serial")
public class CellRender extends JPanel implements ListCellRenderer{
	
	public CellRender() {
		super();
//		super.setSize(100, 40);
	}

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
        super.add(new JLabel(value.toString()));
        setBackground(isSelected ? Color.red : Color.white);
        return this;
	}
}
